package com.xbenmh.order.SpringAop;

import org.aspectj.lang.annotation.*;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;
/**
 * @Author: xben
 * @Date: 2018/12/7 17:41
 */
@Aspect
@Component
public class Audience {
    @Pointcut("execution(public * com.xbenmh.order.controller.AopController.test01(..))")
    public void performance(){
    }
    /**
     * 表演前
     */
    @Before("performance()")
    public void silenceCellPhones(){
        System.out.println("演唱会前卖票了");
    }

    @Before("performance()")
    public void takeSeats(){
        System.out.println("Taking seats");
    }

    @AfterReturning("execution (* com.xbenmh.order.SpringAop.Performance(..))")
    public void applause(){
        System.out.println("CLAP  CLAP  CLAP !!!!");
    }

    @AfterThrowing("execution (* com.xbenmh.order.SpringAop.Performance(..))")
    public void demandRefund(){
        System.out.println("Demanding a refund");
    }

}
